package com.jiazhong.spring.ai.ollama.test;

import jakarta.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.junit.jupiter.api.Test;
import org.springframework.ai.chat.client.ChatClient;
import org.springframework.ai.chat.model.ChatResponse;
import org.springframework.boot.test.context.SpringBootTest;

@Slf4j
//@SpringBootTest
public class App {
    //@Resource
    private ChatClient ollamaChatClient;

    @Test
    public void a() {
        ChatResponse chatResponse = ollamaChatClient.prompt().user("9加上7等于多少？").call().chatResponse();
        log.info("chatResponse:{}", chatResponse);
    }
    @Test
    public void b() {
        String result = ollamaChatClient.prompt().user("9加上7等于多少？").call().content();
        log.info("result:{}", result);
    }
}
